<template>
  <div class="index">
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <div>{{msg}}</div>
    <Test type="error" text="我觉得我有点对你太好了"/>
  </div>
</template>

<script>
import { XButton, Group, DatetimeRange } from 'vux'
import { mapGetters, mapMutations } from 'vuex'
import Test from '../components/test'

export default {
  name: 'index',
  components: {
    XButton,
    Test,
    // Demo,
    Group,
    DatetimeRange
  },
  computed: {
    ...mapGetters({
      getIndexStore: 'getIndexStore'
    })
  },
  created() {
    this.show()
  },
  methods: {
    refresh(val) {
      console.log('change', val)
    },
    infinite(val) {
      console.log('change', val)
    },
    onChange(val) {
      console.log('change', val)
    },
    ...mapMutations(['updata']),
    handleUpdata() {
      this.updata({
        name: 'index',
        payload: {
          a: 2,
          b: 3,
          c: 5,
          d: 6
        }
      })
    },
    show() {
      console.log('this', this.$store)
      console.log('asdafsd', this.getIndexStore('a'))
      console.log('asdafsd', this.getIndexStore('b'))
      console.log('asdafsd', this.getIndexStore('c'))
      console.log('asdafsd', this.getIndexStore('d'))
    }
  },
  data() {
    return {
      msg: '这是一个很简单的首页',
      value: ['2017-01-15', '03', '05']
    }
  }
}
</script>
<style scoped>
h1,
h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
